package com.zte.shopping.service;

import com.zte.shopping.entity.Product;
import com.zte.shopping.entity.ProductType;
import org.apache.commons.fileupload.FileUploadException;
import org.springframework.web.multipart.commons.CommonsMultipartFile;

import javax.servlet.http.HttpSession;
import java.util.List;

public interface ProductService {


    /**
     * @Author zuti
     * @Description //TODO 所有查询商品列表
     * @Date 17:04 2020/6/28
     * @Param [pageIndex]
     * @return java.util.List<com.zte.shopping.entity.ProductType>
     **/
    List<Product> productList(Integer pageIndex);

    /**
     * @Author zuti
     * @Description //TODO 所有查询商品数量
     * @Date 17:05 2020/6/28
     * @Param []
     * @return int
     **/
    int productListCount();

    /**
     * @Author zuti
     * @Description //TODO 根据商品Id来查询这个商品是否存在
     * @Date 14:02 2020/6/30
     * @Param [id]
     * @return com.zte.shopping.entity.Product
     **/
    Product findById(String id);

    /**
     * @Author zuti
     * @Description //TODO 后台修改产品信息
     * @Date 14:02 2020/6/30
     * @Param [file, productId, name, price, typeId, session]
     * @return void
     **/
    void modifyProduct(CommonsMultipartFile file, String productId, String name, String price, String typeId, HttpSession session) throws FileUploadException;

    /**
     * @Author zuti
     * @Description //TODO 后台删除商品
     * @Date 14:02 2020/6/30
     * @Param [id]
     * @return void
     **/
    void removeById(String id);

    /**
     * @Author zuti
     * @Description //TODO 后台添加商品
     * @Date 14:03 2020/6/30
     * @Param [file, productNo, productName, price, typeId, session]
     * @return void
     **/
    void addProduct(CommonsMultipartFile file, String productNo, String productName, String price, String typeId, HttpSession session) throws FileUploadException;

    /**
     * @Author zuti
     * @Description //TODO 前台搜索商品，参数为价格区间，产品类型
     * @Date 14:05 2020/6/30
     * @Param [pageIndex, minPrice, maxPrice, productTypeId]
     * @return java.util.List<com.zte.shopping.entity.Product>
     **/
    List<Product> findProductByParamList(Integer pageIndex, Integer minPrice, Integer maxPrice, Integer productTypeId);



    int productListCountByParam(Integer minPrice, Integer maxPrice, Integer productTypeId);
}
